﻿using System;
using System.ComponentModel.DataAnnotations;

namespace TianYuan.Core.Domain.Entities
{
    public class AggregateRoot<TKey> : Entity<TKey>, IAggregateRoot<TKey>
    {
        /// <summary>
        /// 版本号(乐观锁)
        /// </summary>
        [Timestamp]
        public DateTime Version { get; set; }
    }

    public class AggregateRoot : IAggregateRoot
    {
        [Required]
        [Key]
        public virtual string Id { get; set; }
        /// <summary>
        /// 版本号(乐观锁)
        /// </summary>
        [Timestamp]
        public DateTime Version { get; set; }
    }
}